/******************************************************************************
 cnome: A C++ source "genes" discover. :-)

 See more details at:

   http://www.codeplex.com/cnome

 The original author site is at: http://www.alexandre-barbosa.com/

 Copyright (c) 2008 Alexandre Barbosa.
 Distributed under the MIT License. (See accompanying file LICENSE-MIT.txt 
 or at http://www.codeplex.com/cnome/license)
 ******************************************************************************/

#ifndef CNOME_ITERATOR_H
#define CNOME_ITERATOR_H

#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_symbols.hpp>
#include <iostream>
#include <list>
#include <string>

#include "cnome_typedefs.h"

namespace cnome {
class cnome_iterator : public iterator_T
{
public:
	cnome_iterator();
	cnome_iterator(const cnome_iterator&);
	cnome_iterator(const context_t::iterator_type&);
    const cnome_iterator&  operator++();
	const cnome_iterator   operator++(int);
	token_t&        operator*();
	const std::size_t get_cnome_position() { return m_pos; }
	const iterator_T& getFarest() { return m_farest; }

	friend bool operator<(const cnome_iterator& a, const cnome_iterator& b);
	friend bool operator==(const cnome_iterator& a, const cnome_iterator& b);

	static const iterator_T end;

private:
	std::size_t m_pos;
	void handleMSASM();
	static cnome_iterator& m_farest;
};

bool operator<(const cnome_iterator& a, const cnome_iterator& b);
bool operator==(const cnome_iterator& a, const cnome_iterator& b);
}  // namespace cnome

#endif // CNOME_ITERATOR_H
